#!/bin/sh

# Script to start three workers that can operate on a log file.
# One collects entries, while the other two answer grep and
# count requests.

if [ "$1" = "" ]
then
  echo "usage: $0 <log index>"
  exit 1
fi

gearman -w -f log_collect >> "$0.log.$1" &
gearman -w -f log_grep$1 ./05_worker_grep.sh "$0.log.$1" &
gearman -w -f log_count$1 ./05_worker_count.sh "$0.log.$1" &
